package com.cpe.transfer.member;

import java.util.Date;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

import com.cpe.data.domain.member.appoint.MemberAppoint;
import com.cpe.data.domain.member.appoint.MemberAppointForm;

@Component
public class MemberAppointTransfer {
	/**
	 * 表单-->实体
	 */
	public MemberAppoint toEntity(MemberAppointForm form) {
		Assert.notNull(form);
		MemberAppoint memberAppoint = new MemberAppoint();
		BeanUtils.copyProperties(form, memberAppoint);
		memberAppoint.setCreateTime(new Date());
		if (memberAppoint.getStatus() == null) {
			memberAppoint.setStatus(1);
		}
		return memberAppoint;
	}
}
